import request from '@/plugin/axios'
import util from '@/libs/util.js'

import ApiAccountAccessType from '@/api/settle.accountAccessType'

export default {

    list(data) {
        return request({
            url: 'tradeTrans/list',
            headers: {},
            method: 'post',
            data,
        });
    }, 
    getConfig(data) {
        return request({ 
            url: 'mchInfo/getConfig',
            headers: {},
            method: 'post',
            data,
        });
    },

    addTradeTrans(data) {
        return request({
            url: 'tradeTrans/add',
            headers: {},
            method: 'post',
            data,
        });
    },
    // 获取货币options

    optinos(data) {
        return new Promise ((resolve, reject) => {
			request({
				url: 'currencyCode/list',
				headers: {},
				method: 'post',
				data,
			})
			.then(re => {

				var list = re.list;
				var options = [];

				list.forEach(item => options.push({value: item.code, label: `${item.code}-${item.name}`}));
				resolve(options);
			})
			.catch(err => {
				reject(err);
			});
		});
    },

    // 传入信息 返回配置
    getAmout(data) {
        return request({
            url: 'rateCustomized/getTransRateAndAmount',
            headers: {},
            method: "post",
            data
        })
    },
    // 检查邮箱是否合法
    checkEmail(data) {
        return request({
            url: 'common/checkEmailValid',
            headers: {},
            method: "post",
            data
        })
    },

    getStepOptions (data) {
        return request({
            url: 'common/handleStatusOption',
            headers: {},
            method: 'post',
            data,
        });
    },

};